<include file="common/hearder"/>
<h4><span class="dq  glyphicon glyphicon-user">添加申请人</span></h4>
<div style="width: 100%;height: 1px " class="hr"></div>
<form class="md" method="post">
    <div class="am-form-group col-xs-10 col-md-7">
        <label>申请人</label>
        <input type="hidden" name="stf_id" value="<?php echo $_SESSION['aid']; ?>"/>
        <input type="text" name="name" value="<?php foreach ($staffList as $s){ if($s['stf_id']==$_SESSION['aid']){ echo $s['stf_name'];} }?>" class="form-control">
        <label>申请类型</label>
        <select name="at_type" class="form-control">
            <?php foreach ($typeList as $s){?>
            <option value="<?php echo $s['atrid']?>"><?php echo $s['atrnmae'];?></option>
            <?php }?>
        </select>
        <label>开始时间</label>
        <a class='input-group date' id='datetimepicker1'>
            <input type='text' class="form-control" id='nowdate1' name="at_starttime"/>
            <span class="input-group-addon">
            <span class="glyphicon glyphicon-calendar" onclick="Datetime1()"></span>
        </span>
        </a>
        <label>结束时间</label>
        <a class='input-group date' id='datetimepicker2'>
            <input type='text' class="form-control" id='nowdate2' name="at_endtime"/>
            <span class="input-group-addon">
            <span class="glyphicon glyphicon-calendar" onclick="Datetime2()"></span>
        </span>
        </a>
        <label>申请原因</label>
        <input type="text" name="at_cause" class="form-control" placeholder="请假原因">

        <input type="hidden" name="submit" value="1">
        <button type="submit" class="am-btn am-btn-primary">添加</button>
    </div>
</form>
<script>
    function Datetime1() {
        $('#datetimepicker1').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm-dd',//显示格式
            minView: "month",//设置只显示到月份
            initialDate: new Date(),
            autoclose: true,//选中自动关闭
            todayBtn: true,//显示今日按钮
            locale: moment.locale('zh-cn')
        });
        //默认获取当前日期
        var today = new Date();
        var nowdate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(nowdate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
        document.getElementById("nowdate").value = mydate;
    }

    function Datetime2() {
        $('#datetimepicker2').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm-dd',//显示格式
            minView: "month",//设置只显示到月份
            initialDate: new Date(),
            autoclose: true,//选中自动关闭
            todayBtn: true,//显示今日按钮
            locale: moment.locale('zh-cn')
        });

        //默认获取当前日期
        var today = new Date();
        var nowdate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(nowdate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
        document.getElementById("nowdate2").value = mydate;
    }
</script>
<include file="common/footer"/>